//
//  CycleScrollView.h
//  Rail
//
//  Created by hychen on 2018/3/13.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
    EnumCycleDirectionPortait,          // 垂直滚动
    EnumCycleDirectionLandscape         // 水平滚动
}EnumCycleDirection;

@class CycleScrollView;

@protocol CycleScrollViewDelegate <NSObject>

@optional
- (void)cycleScrollViewDelegate:(CycleScrollView *)cycleScrollView didSelectView:(int)index;

- (void)cycleScrollViewDelegate:(CycleScrollView *)cycleScrollView didScrollView:(int)index;

@end

@interface CycleScrollView : UIView <UIScrollViewDelegate>
@property(nonatomic, weak) id<CycleScrollViewDelegate> delegate;
@property(nonatomic, assign) BOOL isShowUIPageControl;

- (id)initWithFrame:(CGRect)frame cycleDirection:(EnumCycleDirection)direction cycleViews:(NSArray *)cycleViews bgView:(UIView *)bgView;

@property (nonatomic, strong) UIColor *bgColor;

- (void)refreshScrollView;

- (void)startTimer;

- (void)cleanUpTimerAndCache;
@end
